<template>
	<!-- 发布评价 -->
	<view class="page">
		<view class="main">
			<u--textarea  v-model="form.content" height="300rpx" placeholder="请输入你的评价"></u--textarea>
			<view class="title">上传图片</view>
			<c-upLoadImgs :file.sync="form.image"></c-upLoadImgs>
		</view>
		<view class="btn-box">
			<button class="btn" @click="addComments">确定</button>
		</view>
	</view>
</template>

<script>
	export default {
		name: "postingReview",
		data() {
			return {
				form: {
					orderId:null,
					content: '',
					image: []
				}
			};
		},
		onLoad(options) {
	
			this.form.orderId = options.param
			console.log(this.form.orderId)
		},
		onShow() {},
		methods: {
			addComments(){
				if(this.form.content.trim()==''){
					uni.$u.toast('评论为空');
				}else{
				this.$api.addComments(this.form).then(res=>{
						console.log("发布评论")
						uni.$u.toast('评论发布成功');
						setTimeout(()=>{
						uni.switchTab({
							url: '/pages/tabbar/myIdentify'
						});	
						},2000)
				
				});	
				}

				}
	}
	};
</script>

<style lang="scss" scoped>
	.main {
		padding: 32rpx;
		box-sizing: border-box;

		.title {
			font-weight: bold;
			font-size: 28rpx;
			color: #1A1A1A;
			margin:40rpx 0 20rpx;
		}
	}
</style>